package datasource_bak

import (
	"database/sql"
	"gitee.com/kristas/booting-go/framework"
	"gitee.com/kristas/booting-go/framework/core/statement/types"
	"reflect"
)

func init() {
	framework.Component(new(defaultUpgrader))
}

type defaultUpgrader struct {
	types.Component
}

func (d *defaultUpgrader) UpgradeType() reflect.Type {
	return reflect.TypeOf(new(sql.DB))
}

func (d *defaultUpgrader) Upgrade(wrapper Wrapper) (interface{}, error) {
	return wrapper.DB(), nil
}
